//
//  FindCarViewController.m
//  The car
//
//  Created by 赵洋 on 14/11/18.
//  Copyright (c) 2014年 赵洋. All rights reserved.
//

#import "FindCarViewController.h"
#import "FindCollectionCell.h"

@interface FindCarViewController ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

@end

@implementation FindCarViewController
- (void)dealloc
{
    [_tableArr release];
    [_collectionView release];
    [_tableView release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = YES;
    
    [self createCollectionView];
    
}

- (void)createCollectionView
{
    UICollectionViewFlowLayout *lowLayout = [[UICollectionViewFlowLayout alloc] init];
    lowLayout.itemSize = CGSizeMake(350, 700);
    
    self.collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:lowLayout];
    _collectionView.delegate = self;
    _collectionView.dataSource = self;
    _collectionView.backgroundColor = [UIColor redColor];
    _collectionView.pagingEnabled = YES;
    [self.view addSubview:_collectionView];
    [_collectionView release];
    
    [_collectionView registerClass:[FindCollectionCell class] forCellWithReuseIdentifier:@"reuse"];
    
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 2;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    FindCollectionCell *findCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"reuse" forIndexPath:indexPath];
    
    return findCell;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
